import axios from 'axios'

/**
 * 注册请求
 *
 * @param {Object} registerForm 注册表单数据
 */
export const register = registerForm => {
  const { username, password, inviteCode } = registerForm
  return axios.post('http://localhost:3000/auth/register', {
    username,
    password,
    inviteCode
  })
}

/**
 * 登录请求
 *
 * @param {Object} loginForm 登录表单数据
 */
export const login = loginForm => {
  const { username, password } = loginForm
  return axios.post('http://localhost:3000/auth/login', {
    username,
    password
  })
}
